export const dynamicMenu = (permission) => {
  return [
    {
      title: '线索',
      key: 'clue',
      permission: '',
      clue: [
        {
          title: '线索接单',
          url: '/subClue/pages/receivingOrder',
          key: 'clueOrder',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_clue_order.svg',
          permission: permission.serviceProviderFlag
        },
        {
          title: '我处理的',
          url: '/subClue/pages/myRelease?type=2',
          key: 'clue',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_club.svg',
          permission: permission.serviceProviderFlag
        },
        {
          title: '我发布的',
          url: '/subClue/pages/myRelease?type=1',
          key: 'clue',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon-my-posted-it.svg',
          permission: true
        },
        {
          title: '我的投诉',
          url: '/subClue/pages/myComplaint',
          key: 'complaint',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_complaint.svg',
          permission: true
        }
      ]
    },
    {
      title: '佣金',
      key: 'commission',
      permission: '',
      commission: [
        {
          title: '我的返佣',
          url: '/subCommission/pages/backCommission',
          key: 'myCommission',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_commission.svg',
          permission: true
        },
        {
          title: '我的发佣',
          url: '/subCommission/pages/sendingCommission',
          key: 'myCommission',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon-my-commission-post.svg',
          permission: permission.serviceProviderFlag
        },
        {
          title: '提现账户',
          url: '/subCommission/pages/withdrawal',
          key: 'withdrawalAccount',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_withdrawal_account.svg',
          permission: true
        }
      ]
    },
    {
      title: '产品',
      key: 'product',
      permission: permission.serviceProviderFlag === 1,
      product: [
        {
          title: '我加入的',
          url: '/subProduct/pages/myProduct',
          key: 'joined',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_joined.svg',
          permission: true
        },
        {
          title: '接单排行',
          url: '/subProduct/pages/orderRanking',
          key: 'orderRanking',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_order_ranking.svg',
          permission: true
        }
        // {
        //   title: '我的申诉',
        //   key: 'appeal',
        //   icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_appeal.svg',
        //   permission: ''
        // }
      ]
    },
    {
      title: '邀约',
      key: 'invitation',
      permission: '',
      invitation: [
        {
          title: '邀请码',
          key: 'invitationCode',
          url: '/subInvite/pages/code',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_invitation.svg',
          permission: permission.channelProviderFlag === 1 && permission.goldChannelFlag !== 1
        },
        {
          title: '盟友管理',
          key: 'inviteChannel',
          url: '/subChannel/pages/channelManage?type=1',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_invite_channel.svg',
          permission: permission.serviceProviderFlag
        },
        {
          title: '盟友合伙人',
          key: 'agent',
          url: '/subMember/pages/memberCenter?type=1',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_channel_agent.svg',
          permission: permission.pointFlag !== 1
        },
        {
          title: '我的下级',
          key: 'subordinate',
          url: '/subChannel/pages/channelManage?type=3',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_subordinate.svg',
          permission: permission.pointFlag !== 1
        }
      ]
    },
    {
      title: '活动',
      key: 'activity',
      permission: '',
      activity: [
        {
          title: '我报名的',
          url: '/subActivity/pages/mySign',
          key: 'activities',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_activities.svg',
          permission: permission.serviceProviderFlag
        },
        {
          title: '我分享的',
          url: '/subActivity/pages/myShare',
          key: 'activities',
          icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon-my-shared.svg',
          permission: true
        }
      ]
    }
  ];
};

export const menuList = ref([
  {
    title: '线索',
    key: 'clue',
    permission: '',
    clue: [
      {
        title: '线索接单',
        key: 'clueOrder',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_clue_order.svg',
        permission: 1
      },
      {
        title: '我处理的',
        url: '/subClue/pages/myRelease',
        key: 'clue',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_club.svg',
        permission: 1
      },
      {
        title: '我发布的',
        url: '/subClue/pages/myRelease',
        key: 'clue',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon-my-posted-it.svg',
        permission: true
      },
      {
        title: '我的投诉',
        key: 'complaint',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_complaint.svg',
        permission: true
      }
    ]
  },
  {
    title: '佣金',
    key: 'commission',
    permission: '',
    commission: [
      {
        title: '我的返佣',
        key: 'myCommission',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_commission.svg',
        permission: true
      },
      {
        title: '我的发佣',
        key: 'myCommission',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon-my-commission-post.svg',
        permission: 1
      },
      {
        title: '提现账户',
        key: 'withdrawalAccount',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_withdrawal_account.svg',
        permission: true
      }
    ]
  },
  {
    title: '产品',
    key: 'product',
    permission: '',
    product: [
      {
        title: '我加入的',
        url: '/subProduct/pages/myProduct',
        key: 'joined',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_joined.svg',
        permission: true
      },
      {
        title: '接单排行',
        url: '/subProduct/pages/orderRanking',
        key: 'orderRanking',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_order_ranking.svg',
        permission: true
      }
      // {
      //   title: '我的申诉',
      //   key: 'appeal',
      //   icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_appeal.svg',
      //   permission: ''
      // }
    ]
  },
  {
    title: '邀约',
    key: 'invitation',
    permission: '',
    invitation: [
      {
        title: '邀请码',
        key: 'invitationCode',
        url: '/subInvite/pages/code',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_invitation.svg',
        permission: 1
      },
      {
        title: '邀请盟友',
        key: 'inviteChannel',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_invite_channel.svg',
        permission: 1
      },
      {
        title: '盟友合伙人',
        key: 'agent',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_channel_agent.svg',
        permission: true
      },
      {
        title: '我的下级',
        key: 'subordinate',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_subordinate.svg',
        permission: true
      }
    ]
  },
  {
    title: '活动',
    key: 'activity',
    permission: '',
    activity: [
      {
        title: '我报名的',
        key: 'activities',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon_activities.svg',
        permission: 1
      },
      {
        title: '我分享的',
        key: 'activities',
        icon: 'https://mingtu-resources.oss-cn-shenzhen.aliyuncs.com/mtym-app-assets/icon-my-shared.svg',
        permission: true
      }
    ]
  }
]);
